package com.zc.component.network.tcp.client;

import com.zc.component.common.ValueObject;
import com.zc.component.network.tcp.parser.PayloadParserType;
import io.vertx.core.net.NetClientOptions;
import lombok.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class TcpClientProperties implements ValueObject {

    private String id;

    private List<SocketAddress> addresses;

    private String certId;

    private boolean ssl;

    private PayloadParserType parserType;

    private Map<String, Object> parserConfiguration = new HashMap<>();

    private NetClientOptions options;

    private boolean enabled;

    @Override
    public Map<String, Object> values() {
        return parserConfiguration;
    }

    @Getter
    @Setter
    public static class SocketAddress {
        private int port;
        private String host;
    }
}
